<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display" %>
<%@ page contentType="text/html;charset=utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Propiedades</title>
<link href="../../css/jdeveloper.css" rel="stylesheet" media="screen"/>

<script language="javascript">
  function enviar(locacion,destino){
    if(document.frmpropiedades.nombre.value == "")
    {
      alert('Por favor ingrese el nombre');
    }else
    {
      if(document.frmpropiedades.etiqueta.value == "")
      {
        alert('Por favor ingrese la etiqueta');
      }else
      {
        if(document.frmpropiedades.orden.value == "")
        {
          alert('Por favor ingrese el orden');
        }else
        {
          if(document.frmpropiedades.longitud.value == "")
          {
            alert('Por favor ingrese la longitud');
          }else
          {
            document.frmpropiedades.action=locacion;
            document.frmpropiedades.target=destino;
            document.frmpropiedades.submit();
          }
        }
      }
    }
  }
  
  function activarvalor(locacion1)
  {
    document.frmpropiedades.action=locacion1;
    document.frmpropiedades.submit();
  }
</script>
</head>
<body>

 <link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
 <link href="<%= request.getContextPath() + "/css/table.css" %>" rel="stylesheet" type="text/css">
  
  <P></P>
  <form name="frmpropiedades" method="get">
   
      <table align="center" cellspacing="3" cellpadding="2" border="0" width="28%">
      <logic:iterate id="mostrar" name="mostraratri" type="com.cs.beneficios.common.util.Atributo">
        <tr>
          <td class="titulosenblanco" align="center" colspan="2" width="30%">
            <STRONG>Propiedades del Atributo</STRONG>
          </td>
        </tr>
        <tr>
          
          <td class="celdatabla" width="28%">Etiqueta</td>
          <td width="30%">
            <input name="etiqueta" Class="form" type="text" size="30" value='<bean:write name="mostrar" property="etiqueta"/>'/>
          </td>
        </tr>
        
        <tr>
          
          <td class="celdatabla" width="28%">Nombre</td>
          <td width="30%">
            <input name="nombre" Class="form" type="text" size="30" value='<bean:write name="mostrar" property="nombre"/>'/>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="28%">Descripcion</td>
          <td width="30%">
            <textarea name="descripcion" class="form" cols="30" rows="6"><bean:write name="mostrar" property="descripcion"/></textarea>
            
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="28%">Orden</td>
          <td width="30%">
            <input name="orden" Class="form" type="text" size="5" value='<bean:write name="mostrar" property="orden"/>'/>
            <input type="image" src="<%=request.getContextPath() + "/images/ver.gif"%>" name="Ver" value="Ver" onclick="enviar('MostrarOrdenAtri.do','blank')"/>
          </td>
          <td>&nbsp;
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="28%">Tipo de Atributo</td>
          
          <% String tipoatri = (String)session.getAttribute("tipoatributo"); %>
          <td width="30%">
              
               <html:select property="tipoatributo" name="mostrar" styleClass="form"  value="<%=tipoatri%>">
                    <html:option value="R">Beneficiario</html:option>
                    <html:option value="B">Beneficio</html:option>
                    
               </html:select>
  
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="28%">Tipo de Dato</td>
           <% String tipodato = (String)session.getAttribute("tipodato"); %>
          <td width="30%">
            <html:select property="tipodato" name="mostrar" styleClass="form"  value="<%=tipodato%>">
                 <html:option value="A">Alfanum&eacute;rico</html:option>
                 <html:option value="F">Fecha</html:option>
                 <html:option value="N">Num&eacute;rico</html:option>
                 <html:option value="L">Solo Letras (A-Z)</html:option>
            </html:select>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="28%">Longitud</td>
          <td width="30%">
            <input name="longitud" Class="form" type="text" size="5" value='<bean:write name="mostrar" property="longitud"/>'/>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="28%">Obligatorio</td>
          <% String obligatorio = (String)session.getAttribute("obligatorio"); %>
          <td width="30%">
            <html:select  property="obligatorio" name="mostrar" styleClass="form"  value="<%=obligatorio%>">
                    <html:option value="S">Si</html:option>
                    <html:option value="N">No</html:option>
                    
             </html:select>
          </td>
        </tr>
        <% Object ObjValorS = session.getAttribute("valorsugerido");
           if (ObjValorS != null)
           {
        %>
              <tr>
                <td class="celdatabla" width="28%">Valor Sugerido</td>
                <td width="30%">
                  <logic:present name="listatam" scope="session">
                    <logic:iterate id="lista" name="listatam" type="com.cs.beneficios.business.model.ValorFlexibleVO">
                      <% String codigo = (String)session.getAttribute("valorsugerido");%>
                      <html:select name="lista" property="codigovfl" styleClass="form" value="<%=codigo%>">
                        <html:options name="valorflex" labelName="codigovfl" labelProperty="descripcionvf" property="codigovfl" collection="valorflex"/>
                      </html:select>
                    </logic:iterate>
                  </logic:present>
                   <%session.removeAttribute("valorsugerido");%>
                </td>
              </tr>
          <%} %>
        <tr>
          <td class="celdatabla" width="28%">Lista Valores</td>
          <% String dominio = (String)session.getAttribute("vallista"); %>
          <td width="30%">
            <html:select property="valLista" name="mostrar" styleClass="form"  value="<%=dominio%>">
                    <html:option value="S">Si</html:option>
                    <html:option value="N">No</html:option>
                    
             </html:select>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="28%">Vigencia</td>
           <% String vigencia = (String)session.getAttribute("vigencia"); %>
          <td width="30%">
            <html:select property="vigencia" name="mostrar" styleClass="form"  value="<%=vigencia%>">
                    <html:option value="A">Activo</html:option>
                    <html:option value="I">Inactivo</html:option>
                    
             </html:select>
          </td>
        </tr>
  </logic:iterate>
      </table>
      <P></P>
      <DIV align="center">
        <P>
          <input type="hidden" name="codatributo" value="<%=request.getParameter("codatributo")%>"/>
          <%  String tipovalorflex = (String)session.getAttribute("tipovalorflex"); %>
          <input type="hidden" name="tipovalorflex" value="<%=tipovalorflex%>"/>
          <% 
            if(!tipovalorflex.equals(""))
            {
        %>
          <input type="button" value="Ver Lista" language="javascript" onclick="enviar('BuscarDominios.do','')"/>
          <%   
            }else
            {
        %>
          <input disabled="disabled" type="button" value="Ver Lista"/>
          <%   }%>
          <input type="button" value="Guardar" language="javascript" onclick="enviar('ModificarAtri.do','')"/>
          <%  
          String Ruta4 = "'"+request.getContextPath() + "/BuscarAtributo.do'"; 
          String codeSubpro = (String)session.getAttribute("codsubpro");%>
        </P>
        <P>
          <input type="hidden" name="accion" value="1"/>
          <input type="hidden" name="codigo" value="<%=codeSubpro%>"/>
          <input type="image" onclick="activarvalor(<%=Ruta4%>)" src="<%= request.getContextPath() + "/images/b_atras.gif" %>"/>
        </P>
      </DIV>
   
    
  </form>
  </body>
  </html>
